{% extends "uddi/base.html" %}

{% block title %}- view service {{service.name|lower}}{% endblock %}
{% block content %}
<h2>Service: {{service.name}}</h2>

{% if userIsOwner %}
<div class="serviceUpdateMenu">
<h3>Administrate</h3>
  <ul>
    <li><a href="{{base_url}}editService/{{service.id}}/" class="edit">edit</a></li>
    <li>
      {% if service.public %}
      <a href="{{base_url}}hideService/{{service.id}}/" class="hide">hide</a></li>
      {% else %}
      <a href="{{base_url}}showService/{{service.id}}/" class="show">show</a></li>
      {% endif %}
    <li><a href="{{base_url}}deleteService/{{service.id}}/" class="delete">delete</a></li>
  </ul>
</div>
{% endif %}

<div class="serviceDescription">
<h3>Description</h3>
{{service.desc|linebreaks }}
</div>

<div class="serviceInformations">
<h3>Informations</h3>
<ul>
  <li>Vendor: <a href="{{base_url}}vendor/{{service.producedBy.id}}">{{service.producedBy}}</a></li>
  <li>URI: <a href="{{service.url}}">{{service.url}}</a></li>
  <li>WSDL file: <a href="{{service.wsdl}}">{{service.wsdl}}</a></li>
  <li>Categories:
  {% for cat in service.categories.all %}
  <a href="{{base_url}}services/cat/{{cat.slug}}">{{cat.name}}</a> 
  {% endfor %}
  </li>
  <li>Keywords:
    {% for kw in service.keywords.all %}
  <a href="{{base_url}}services/keyword/{{kw.slug}}">{{kw.name}}</a> 
  {% endfor %}
  </li>
  </li>
</ul>
</div>

<div class="serviceValidation">
<h3>Validation</h3>
<table class="mainTable">
<caption>Unitary mark</caption>
<tr>
	<th>Operation</th><th>Category</th><th>Results</th>
</tr>
{% for op, valid in unitaryMark.items %}
  {% for cat, valid1 in valid.items %}
	<tr>
	    {% ifequal cat.abbr "FIA" %}
	      <td class="tdOperation" rowspan="4">{{op.name}}</td>
	    {% endifequal %}
	    <td class="tdCategory"><acronym title="{{cat.name}}">{{cat.abbr}}</acronym></td>
	    <td class="size_100 tdVerdict">
	      <ul>
	      {% for verdict, value in valid1.items %}
	        <li class="verdict verdict_{{verdict.name|slugify}} size_{{value.1}}" ><span class="invisible">{{verdict.name}}: </span>
		{% ifnotequal value.0 0 %}
	            {{value.0}} ( {{value.1}}%)
		{% else %}
		  <span class="invisible">{{value.0}} ( {{value.1}}%)</span>
	          {% endifnotequal %}
	       </li>
	      {% endfor %}
	      </ul>
	    </td>
	</tr>
  {% endfor %}
{% endfor %}
</table>

<table class="mainTable">
<caption>Relation mark</caption>
<tr>
	<th>Operation</th><th>Category</th><th>Results</th>
</tr>
{% for op, valid in relationMark.items %}
  {% for cat, valid1 in valid.items %}
	<tr>
	    {% ifequal cat.abbr "FIA" %}
	      <td class="tdOperation" rowspan="4">{{op.name}}</td>
	    {% endifequal %}
	    
	    <td class="tdCategory"><acronym title="{{cat.name}}">{{cat.abbr}}</acronym></td>
	    <td class="size_100 tdVerdict">
	      <ul>
	      {% for verdict, value in valid1.items %}
	        <li class="verdict verdict_{{verdict.name|slugify}} size_{{value.1}}" ><span class="invisible">{{verdict.name}}: </span>
		{% ifnotequal value.0 0 %}
	            {{value.0}} ( {{value.1}}%)
		{% else %}
		  <span class="invisible">{{value.0}} ( {{value.1}}%)</span>
	          {% endifnotequal %}
	       </li>	
	      {% endfor %}
	      </ul>
	    </td>
	</tr>
  {% endfor %}
{% endfor %}
</table>

<table class="mainTable">
<caption>Detailled relation mark - coming soon</caption>
<tr>
	<th>Operation</th><th>Category</th><th class="size_100">Results</th>
</tr>
</table>

</div>

{% endblock %}